package com.xingzhi.controller;

import com.xingzhi.entity.User;
import com.xingzhi.feign.UserFeignHystrixClient;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RestController;

/**
 * @ClassName FeignController
 * @DESCRIPTION TODO
 * @Author RuanlinJing
 * @Date 2018/6/21 23:04
 * @Version 1.0
 **/
@RestController
public class FeignController {
    @Autowired
    private UserFeignHystrixClient userFeignHystrixClient;

    @GetMapping("feign/{id}")
    public User findByIdFeign(@PathVariable Long id) {
        User user = this.userFeignHystrixClient.findByIdFeign(id);
        return user;
    }
}
